package com.groupten.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Objects;


/**
 * 错题库表
 */
@Data
@TableName("wq_house")
public class WqHouseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 错题编号
     */
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long houseId;
    /**
     * 错题科目
     */
    private Integer subject;

    /**
     * 对应题库中题目编号
     */
    private Integer questionId;

    /**
     * 错题类型
     */
    private Integer questionType;

    /**
     * 错题知识点
     */
    private Integer knowledgePoint;

    /**
     * 错题分值
     */
    private Double score;

    /**
     * 错题难度
     */
    private Double level;

    /**
     * 学生学号
     */
    private String studentNumber;

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        WqHouseEntity that = (WqHouseEntity) o;
        return Objects.equals(questionId, that.questionId) && Objects.equals(studentNumber, that.studentNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(questionId, studentNumber);
    }
}
